package com.rich.util;

import android.app.Notification;
import android.app.NotificationManager;
import android.content.Context;

public class LedTestUtils {
	private Context mContext;
	private NotificationManager manager;
	private Notification notification;

	public LedTestUtils(Context context) {
		mContext = context;
	}

	public void openTricolourLight(int color) {
		manager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);
		notification = new Notification();
		notification.ledARGB = color;
		notification.ledOnMS = 1;
		notification.ledOffMS = 0;
		notification.flags = Notification.FLAG_SHOW_LIGHTS;
		manager.notify(20171018, notification);
	}

	public void closeTricolourLight() {
		if (manager != null) {
			manager.cancel(20171018);
		}

	}

}
